//package com.gitlab.lucky.admin.service;
//
//import com.gitlab.lucky.common.dao.mapper.AdminRoleMapper;
//import com.gitlab.lucky.common.dao.mapper.AdminRoleUserMapper;
//import com.gitlab.lucky.common.dao.model.AdminRole;
//import com.gitlab.lucky.common.dao.model.AdminRoleUser;
//import com.gitlab.lucky.common.service.ServiceImpl;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//import tk.mybatis.mapper.entity.Example;
//
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * @program: lucky
// * @author: Mr.Han
// * @create: 2019-04-21 18:20
// **/
//@Service
//public class AdminRoleService extends ServiceImpl<AdminRoleMapper, AdminRole> {
//    @Autowired
//    private AdminRoleUserService adminRoleUserService;
//    public List<AdminRole> selectById(Long id) {
//        //根据用户id查询角色
//        ArrayList roleIdList = new ArrayList<>();
//        List<AdminRoleUser> adminRoleUserList = adminRoleUserService.listByUserId(id);
//        for (AdminRoleUser adminRoleUser : adminRoleUserList) {
//            roleIdList.add(adminRoleUser.getRoleId());
//        }
//        Example example = new Example(AdminRole.class);
//        example.createCriteria().andIn("id",roleIdList);
//        List<AdminRole> adminRoles = this.selectByExample(example);
//        return adminRoles;
//    }
//}
